{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt  \n",
    "import numpy as np \n",
    "from sklearn import datasets\n",
    "import time\n",
    "from sklearn import metrics\n",
    "import os\n",
    "import pandas as pd\n",
    "from sklearn.preprocessing import StandardScaler\n",
    "plt.rcParams['font.sans-serif'] = ['SimHei']\n",
    "plt.rcParams['axes.unicode_minus'] = False "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>plot_id</th>\n",
       "      <th>nmws</th>\n",
       "      <th>ntree</th>\n",
       "      <th>dbh2_ratio</th>\n",
       "      <th>num_ratio</th>\n",
       "      <th>biomass</th>\n",
       "      <th>nsp</th>\n",
       "      <th>sprichness</th>\n",
       "      <th>shannon</th>\n",
       "      <th>simpon</th>\n",
       "      <th>pielou</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.csv</td>\n",
       "      <td>13</td>\n",
       "      <td>14</td>\n",
       "      <td>0.993235</td>\n",
       "      <td>0.928571</td>\n",
       "      <td>11.067633</td>\n",
       "      <td>2</td>\n",
       "      <td>0.142857</td>\n",
       "      <td>0.371232</td>\n",
       "      <td>0.132653</td>\n",
       "      <td>0.371232</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2.csv</td>\n",
       "      <td>23</td>\n",
       "      <td>29</td>\n",
       "      <td>0.932001</td>\n",
       "      <td>0.793103</td>\n",
       "      <td>11.722384</td>\n",
       "      <td>2</td>\n",
       "      <td>0.068966</td>\n",
       "      <td>0.735509</td>\n",
       "      <td>0.328181</td>\n",
       "      <td>0.735509</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3.csv</td>\n",
       "      <td>16</td>\n",
       "      <td>26</td>\n",
       "      <td>0.919846</td>\n",
       "      <td>0.615385</td>\n",
       "      <td>13.197564</td>\n",
       "      <td>7</td>\n",
       "      <td>0.269231</td>\n",
       "      <td>1.854286</td>\n",
       "      <td>0.585799</td>\n",
       "      <td>0.660510</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.csv</td>\n",
       "      <td>27</td>\n",
       "      <td>32</td>\n",
       "      <td>0.987783</td>\n",
       "      <td>0.843750</td>\n",
       "      <td>18.711371</td>\n",
       "      <td>2</td>\n",
       "      <td>0.062500</td>\n",
       "      <td>0.625262</td>\n",
       "      <td>0.263672</td>\n",
       "      <td>0.625262</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.csv</td>\n",
       "      <td>22</td>\n",
       "      <td>22</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>9.254236</td>\n",
       "      <td>1</td>\n",
       "      <td>0.045455</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>83</th>\n",
       "      <td>85.csv</td>\n",
       "      <td>31</td>\n",
       "      <td>56</td>\n",
       "      <td>0.851322</td>\n",
       "      <td>0.553571</td>\n",
       "      <td>1.482282</td>\n",
       "      <td>2</td>\n",
       "      <td>0.035714</td>\n",
       "      <td>0.991703</td>\n",
       "      <td>0.494260</td>\n",
       "      <td>0.991703</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>84</th>\n",
       "      <td>86.csv</td>\n",
       "      <td>0</td>\n",
       "      <td>23</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.214053</td>\n",
       "      <td>1</td>\n",
       "      <td>0.043478</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>85</th>\n",
       "      <td>87.csv</td>\n",
       "      <td>12</td>\n",
       "      <td>12</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>12.210925</td>\n",
       "      <td>1</td>\n",
       "      <td>0.083333</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>86</th>\n",
       "      <td>88.csv</td>\n",
       "      <td>15</td>\n",
       "      <td>15</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>11.355286</td>\n",
       "      <td>1</td>\n",
       "      <td>0.066667</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>87</th>\n",
       "      <td>89.csv</td>\n",
       "      <td>11</td>\n",
       "      <td>11</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>10.068231</td>\n",
       "      <td>1</td>\n",
       "      <td>0.090909</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>88 rows × 11 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   plot_id  nmws  ntree  dbh2_ratio  num_ratio    biomass  nsp  sprichness  \\\n",
       "0    1.csv    13     14    0.993235   0.928571  11.067633    2    0.142857   \n",
       "1    2.csv    23     29    0.932001   0.793103  11.722384    2    0.068966   \n",
       "2    3.csv    16     26    0.919846   0.615385  13.197564    7    0.269231   \n",
       "3    4.csv    27     32    0.987783   0.843750  18.711371    2    0.062500   \n",
       "4    5.csv    22     22    1.000000   1.000000   9.254236    1    0.045455   \n",
       "..     ...   ...    ...         ...        ...        ...  ...         ...   \n",
       "83  85.csv    31     56    0.851322   0.553571   1.482282    2    0.035714   \n",
       "84  86.csv     0     23    0.000000   0.000000   0.214053    1    0.043478   \n",
       "85  87.csv    12     12    1.000000   1.000000  12.210925    1    0.083333   \n",
       "86  88.csv    15     15    1.000000   1.000000  11.355286    1    0.066667   \n",
       "87  89.csv    11     11    1.000000   1.000000  10.068231    1    0.090909   \n",
       "\n",
       "     shannon    simpon    pielou  \n",
       "0   0.371232  0.132653  0.371232  \n",
       "1   0.735509  0.328181  0.735509  \n",
       "2   1.854286  0.585799  0.660510  \n",
       "3   0.625262  0.263672  0.625262  \n",
       "4   0.000000  0.000000       NaN  \n",
       "..       ...       ...       ...  \n",
       "83  0.991703  0.494260  0.991703  \n",
       "84  0.000000  0.000000       NaN  \n",
       "85  0.000000  0.000000       NaN  \n",
       "86  0.000000  0.000000       NaN  \n",
       "87  0.000000  0.000000       NaN  \n",
       "\n",
       "[88 rows x 11 columns]"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "file_path = r'./使用数据'\n",
    "data = pd.read_csv(os.path.join(file_path,'样地统计信息.csv'),encoding='utf_8_sig',engine='python')\n",
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>nsp</th>\n",
       "      <th>sprichness</th>\n",
       "      <th>biomass</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2</td>\n",
       "      <td>0.142857</td>\n",
       "      <td>11.067633</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>0.068966</td>\n",
       "      <td>11.722384</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>7</td>\n",
       "      <td>0.269231</td>\n",
       "      <td>13.197564</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2</td>\n",
       "      <td>0.062500</td>\n",
       "      <td>18.711371</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1</td>\n",
       "      <td>0.045455</td>\n",
       "      <td>9.254236</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   nsp  sprichness    biomass\n",
       "0    2    0.142857  11.067633\n",
       "1    2    0.068966  11.722384\n",
       "2    7    0.269231  13.197564\n",
       "3    2    0.062500  18.711371\n",
       "4    1    0.045455   9.254236"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#选择用于聚类的参数\n",
    "df = pd.DataFrame(data,columns=['nsp','sprichness','biomass'])\n",
    "df.head(5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "ss_x = StandardScaler().fit(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[-4.98152721e-01,  6.94843948e-01, -2.08977026e-02],\n",
       "       [-4.98152721e-01, -4.49854107e-01,  7.06517043e-02],\n",
       "       [ 2.20786206e+00,  2.65257112e+00,  2.76915958e-01],\n",
       "       [-4.98152721e-01, -5.50015183e-01,  1.04787358e+00],\n",
       "       [-1.03935568e+00, -8.14076217e-01, -2.74452492e-01],\n",
       "       [-4.98152721e-01, -2.78912528e-01, -4.94675067e-02],\n",
       "       [-4.98152721e-01, -3.26578928e-01, -4.19726769e-01],\n",
       "       [-4.98152721e-01, -6.33005794e-01, -2.87418541e-01],\n",
       "       [ 4.30502351e-02, -1.90389208e-01,  1.10919556e-01],\n",
       "       [-1.03935568e+00, -9.64968221e-01,  1.99612782e-01],\n",
       "       [-1.03935568e+00, -9.64968221e-01,  2.17815877e-01],\n",
       "       [ 1.66665910e+00,  2.05674112e+00, -2.98831323e-01],\n",
       "       [-4.98152721e-01, -4.11697509e-01,  1.22333947e+00],\n",
       "       [-4.98152721e-01,  8.65081094e-01,  7.41017532e-01],\n",
       "       [-1.03935568e+00, -5.50015183e-01,  1.23523664e+00],\n",
       "       [ 1.12545615e+00,  2.35465612e+00,  2.91581361e+00],\n",
       "       [-4.98152721e-01, -1.09913469e-01,  1.38078550e+00],\n",
       "       [ 4.30502351e-02,  5.94249263e-01,  5.21735247e+00],\n",
       "       [ 4.30502351e-02,  1.41573220e-01, -2.56690896e-01],\n",
       "       [ 5.84253191e-01,  5.47305081e-01, -1.83115823e-01],\n",
       "       [ 1.12545615e+00,  8.28970189e-01,  7.28401135e-02],\n",
       "       [ 4.30502351e-02,  1.38643235e+00, -5.77231565e-01],\n",
       "       [-4.98152721e-01, -7.43659936e-01,  8.88364157e-01],\n",
       "       [ 1.12545615e+00,  3.70978164e-01,  5.74509829e-01],\n",
       "       [ 1.66665910e+00,  1.58007710e+00, -1.61084533e-01],\n",
       "       [-4.98152721e-01, -8.29724278e-01, -1.41787883e+00],\n",
       "       [ 4.30502351e-02,  1.06369110e+00,  1.57120529e+00],\n",
       "       [-1.03935568e+00, -7.02892619e-01,  3.34553391e-01],\n",
       "       [ 4.30502351e-02,  1.06369110e+00,  4.67348172e-01],\n",
       "       [ 1.66665910e+00,  2.52304286e+00, -4.71281985e-01],\n",
       "       [ 5.84253191e-01,  1.12453712e-01, -3.67486655e-01],\n",
       "       [ 2.20786206e+00,  2.22110801e+00,  5.48407868e-02],\n",
       "       [ 5.84253191e-01,  7.06410846e-02,  7.37682621e-02],\n",
       "       [-4.98152721e-01, -1.71145009e-01,  3.01070685e-01],\n",
       "       [ 4.30502351e-02,  1.41573220e-01,  3.38992369e-01],\n",
       "       [ 4.30502351e-02,  5.02401961e-01, -2.40315744e-01],\n",
       "       [-1.03935568e+00, -9.22408946e-01,  4.14055516e-01],\n",
       "       [-1.03935568e+00, -9.84046521e-01, -6.61419311e-02],\n",
       "       [-1.03935568e+00, -7.43659936e-01,  3.18683968e-01],\n",
       "       [ 1.12545615e+00,  6.94843948e-01,  7.88990450e-01],\n",
       "       [ 4.30502351e-02, -1.90537554e-02,  2.73472158e-01],\n",
       "       [ 5.84253191e-01,  1.17594892e+00, -2.80674208e-01],\n",
       "       [ 4.30502351e-02,  2.69251075e-01,  3.25649082e-01],\n",
       "       [-4.98152721e-01, -6.33005794e-01,  1.56626757e+00],\n",
       "       [-1.03935568e+00, -9.84046521e-01, -1.50739294e+00],\n",
       "       [-4.98152721e-01, -2.27273932e-01, -1.52682014e+00],\n",
       "       [-4.98152721e-01, -3.70714486e-01,  1.20382261e+00],\n",
       "       [-1.03935568e+00, -1.00185295e+00,  9.16409244e-01],\n",
       "       [-1.03935568e+00, -1.09954759e+00, -9.90007273e-01],\n",
       "       [-4.98152721e-01, -8.29724278e-01, -1.35744954e+00],\n",
       "       [ 5.84253191e-01,  8.65081094e-01, -1.49806259e+00],\n",
       "       [-1.03935568e+00, -9.84046521e-01, -1.51847685e+00],\n",
       "       [ 1.66665910e+00,  5.47305081e-01,  7.83742744e-02],\n",
       "       [ 5.84253191e-01, -2.78912528e-01,  1.25043666e+00],\n",
       "       [ 4.30502351e-02,  2.03047745e-01, -8.90601869e-01],\n",
       "       [ 2.20786206e+00,  1.58007710e+00, -6.27845895e-01],\n",
       "       [ 1.12545615e+00,  4.67861081e-01,  1.25712148e-01],\n",
       "       [ 2.20786206e+00,  2.59483371e-01,  3.88615551e-01],\n",
       "       [ 1.12545615e+00, -1.09913469e-01,  7.96819217e-01],\n",
       "       [ 4.30502351e-02,  3.40750682e-01,  1.06422466e-01],\n",
       "       [ 4.30502351e-02, -2.62164875e-01, -1.29592008e-02],\n",
       "       [-4.98152721e-01, -1.10513014e+00, -8.29588927e-02],\n",
       "       [ 4.30502351e-02,  3.40750682e-01,  1.06422466e-01],\n",
       "       [-4.98152721e-01, -1.20208425e+00, -9.98409992e-01],\n",
       "       [-4.98152721e-01, -1.23911138e+00, -9.29676363e-01],\n",
       "       [-1.03935568e+00, -1.38583227e+00, -1.05377084e+00],\n",
       "       [ 4.30502351e-02, -9.84046521e-01, -8.89822272e-01],\n",
       "       [-1.03935568e+00, -1.35686832e+00, -9.87510047e-01],\n",
       "       [-1.03935568e+00, -1.23135783e+00, -1.16788513e+00],\n",
       "       [ 1.66665910e+00,  1.06369110e+00,  1.97151311e-01],\n",
       "       [ 5.84253191e-01,  2.03047745e-01,  3.99850248e-02],\n",
       "       [ 5.84253191e-01,  4.18208584e-01, -2.92745321e-01],\n",
       "       [ 1.66665910e+00,  1.48013142e+00, -7.74602069e-03],\n",
       "       [ 1.66665910e+00,  1.29841201e+00,  5.88651457e-01],\n",
       "       [ 2.74906501e+00,  2.61284913e+00, -1.41607615e-03],\n",
       "       [-1.03935568e+00, -1.12101894e+00,  4.84148942e-01],\n",
       "       [-1.03935568e+00, -9.44476718e-01,  2.94627032e-01],\n",
       "       [ 4.30502351e-02, -1.09913469e-01, -6.39531164e-02],\n",
       "       [-1.03935568e+00, -7.80544645e-01, -7.12871533e-01],\n",
       "       [-1.03935568e+00, -1.01851055e+00, -5.10947274e-01],\n",
       "       [-1.03935568e+00, -1.08791727e+00, -8.91081840e-01],\n",
       "       [-4.98152721e-01, -8.14076217e-01, -1.40405754e+00],\n",
       "       [ 4.30502351e-02, -4.37431022e-01, -1.38039634e+00],\n",
       "       [-4.98152721e-01, -9.64968221e-01, -1.36115119e+00],\n",
       "       [-1.03935568e+00, -8.44691979e-01, -1.53847898e+00],\n",
       "       [-1.03935568e+00, -2.27273932e-01,  1.38960977e-01],\n",
       "       [-1.03935568e+00, -4.85466927e-01,  1.93228327e-02],\n",
       "       [-1.03935568e+00, -1.09913469e-01, -1.60637121e-01]])"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stand_df = ss_x.transform(df)\n",
    "stand_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "KMeans(n_clusters=3)"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.cluster import KMeans\n",
    "estimator = KMeans(n_clusters=3)  # 构造聚类器\n",
    "estimator.fit(stand_df)  # 聚类\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXsAAAESCAYAAAAcxXWZAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAAC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Ciat2ApcTDGwaJAi6ZwLfA24HZrh7Hxyqsb/s7reFz48J9/k6sJzg/6mJYC4cwue9BD8Wr4XLBoCrwm2uc/f5ZvZugvlYlpX0kxBJo5q91BQzuxrYDkwmqG3/HrAN6ATeB/wLsIcg+L8XeBjYRPCjcJC0CpC7/4OZ/QXwZwQ/BBMJfjB2heutcve/T9v3/cDQWTq3uvuCtHVuC8s3DXg78AQwLrxtdfc/LcHHIHIU1eyl1vwLsJsg2J9EkIb5OrAAmAOMJJik6gvABcBjBLX7bFYCX3P3/rBm3+fuN4W1+qH/P3uBHw1ZNnHI81HANwimPF5F8EMzAfiVu381+mGK5EfBXmrNW4DPEtScf0qQ0nkcOBV4hGAo/D7g8wRD258L1+kCnCB/DvCVsOG2z90PDt2Jux8wsxFm1uru+8IzihPD2xHMbLG7fyV8+jsEZxlLCdI7qSmcjzezxkz7EikFpXGkppjZ24BjCOYqWUeQsnkOuJegdv9XBDX/VuAsd3+3mf0xQS79LQQVoKeBBoI0zwUE6R0IaumDwK/D5yOBbne/2cxuJZh/fxfBj8dogrx/G8FUxleF5XvE3WeEZwb3h2W6HHjW3dfG8JGIAKrZS41x91/BEf3cfw10A/9IEPhPAr5F0Evn3nCb74XbzAufbwq3/QmwJPXe6WmcfIsVbj+ZcJ708MzgKwSTvf0I+Ns831MkLwr2UqtaCXrGzCHIj/+A4IIh33f3HwGYWZ+ZNbl7f7jNSHL/TzTneL2J4JKKfWnLziHI0afmqZ8E/D8z+zpwHMHUuRcRpHLuCCeA+4K7fz/6YYpEozSOSAmEaZk3XP9QklAK9iIidUDTJYiI1AEFexGROqBgLyJSBxTsRUTqwH8D9RzDI5Rb42QAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "label_pred = estimator.labels_  # 获取聚类标签\n",
    "# x0 = df[label_pred == 0]\n",
    "# # x1 = df[label_pred == 1]\n",
    "x0 = ss_x.inverse_transform(stand_df[label_pred == 0])\n",
    "x1 = ss_x.inverse_transform(stand_df[label_pred == 1])\n",
    "x2 = ss_x.inverse_transform(stand_df[label_pred == 2])\n",
    "# x2 = df[label_pred == 2]\n",
    "plt.scatter(x0[:,1], x0[:,2], c=\"red\", marker='o', label='a')  \n",
    "plt.scatter(x1[:,1], x1[:,2], c=\"green\", marker='*', label='b')  \n",
    "plt.scatter(x2[:,1], x2[:,2], c=\"blue\", marker='+', label='c')  \n",
    "plt.xlabel('物种丰富度')  \n",
    "plt.ylabel('生物量') \n",
    "plt.legend(loc=1)  \n",
    "plt.text(x = -0.01 ,y = 52 , s = r'$Mg·hm^{-2}$',size=8)\n",
    "# matplotlib.mathtext()\n",
    "# plt.savefig(r'G:\\python林业资源\\出图/聚类k-mean.png',dpi=300)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "        nsp  sprichness    biomass  类别数目\n",
      "0  1.486486    0.045879   6.987218    37\n",
      "1  2.906250    0.102499  15.758393    32\n",
      "2  5.736842    0.191941  11.805704    19\n"
     ]
    }
   ],
   "source": [
    "center_ids = estimator.cluster_centers_\n",
    "r1 = pd.Series(label_pred).value_counts()\n",
    "r2 = pd.DataFrame(ss_x.inverse_transform(center_ids))\n",
    "r = pd.concat([r2, r1], axis = 1)\n",
    "r.columns = [u'nsp',u'sprichness',u'biomass'] + [u'类别数目']\n",
    "print(r)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "MeanShift(bandwidth=1.4, n_jobs=1)"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.cluster import MeanShift,estimate_bandwidth \n",
    "ms = MeanShift(bandwidth=1.4,seeds=None,bin_seeding=False,min_bin_freq=1,cluster_all=True,n_jobs=1)\n",
    "ms.fit(stand_df)  # 聚类"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1.6085988643914957"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "bandwidth = estimate_bandwidth(df,quantile=0.05,n_samples=len(df))\n",
    "bandwidth"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXsAAAESCAYAAAAcxXWZAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAj0UlEQVR4nO3df5QcZZ3v8fd3Jh2SzGAgIYxCdjoYUH64cC8JipwsmYCoqIsiiDCBxMMuuQb0uLtXztUbr4cMJOxdWZSL4L1ZuMiagbOJaAQJ/jb8XJTAPbIkwgY1gSCwIUhCDIND5nv/qB7SmfSP6u6qruquz+ucPtNdUz+eqpn+1lPf56mnzN0REZH21pF0AUREJH4K9iIiGaBgLyKSAQr2IiIZoGAvIpIBCvYiIhmgYC8ikgEK9iIiGTAu6QIkzczeD8wCDnP3zyZdHhGROKSiZm9mPzCzFUWfHzCzfwqx3P81s8Mb2ba7/8jdrwZyjaxHRCTN0lKz7wIOAjCzPmACsDHEcn/m7s+F3YiZnQ4sLpq02N23mdnfALeGXY+ISKtJPNib2YHATmCkMGkx8HNgo5n9d+CDwC+AI9z93KLlDDjIzG4C/gL4tLv/3Mx+QXCimAN8EZgPvAM4xd1/Cvx0zPYvBd5deP+wa7AgEWlDaUjjHAM8CbxqZnOBfwcOB4aAGe5+KvA08KSZvdXMlhSWywMGXAZ8Gugzs16CdMx/AZYBH3f3s4F7gGNLbdzdb3T3fnf/mgK9iLSrxGv2BEF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LXtdwHPADOAjwLfA7YTBP8PAj8G1hOcFN6gqALk7t80s78FPkFwIphOcMJ4sTDfze7+T0XbvgsYO0rnJne/pGiemwrlmwO8E3gMOKTw2uTufxnBYRDZj2r20m6+B2wjCPYzCdIw3wAuAfqB8QSDVH0ZOBO4n6B2X84K4OvuPlyo2Q+5+9cKtfqx35+dwINjpk0f83kC8H8Ihjy+meBEcxjwW3e/JvxuitRGwV7azduALxDUnH9JkNJ5FDga+DnBrfC7gC8R3Nr+dGGePsAJ8ucAXyk03A65+xtjN+Lur5tZh5l1u/uuwhXF4YXXPszscnf/SuHjWwiuMgYI0jujQzgfbGbjSm1LJApK40hbMbO3AwcQjFWyjiBl8zSwhqB2/3mCmn83MMvd32dm7yfIpb+NoAL0BNBJkOY5kyC9A0EtfQT4feHzeGDQ3a8zsxsIxt9/keDkMZEg799DMJTxZYXy/dzd5xWuDO4qlGkB8KS7r47hkIgAqtlLm3H338I+/dx/DwwC/0wQ+GcC/0LQS2dNYZkfFZa5sPB5fWHZXwBLR9ddnMaptViF5Y+lME564crgKwSDvT0I/GON6xSpiYK9tKtugp4x/QT58Z8RPDDkp+7+IICZDZlZzt2HC8uMp/J3YlKF3+cIHqk4VDTt3QQ5+tFx6o8A/reZfQM4iGDo3I8QpHJuLQwA92V3/2n43RQJR2kckQgU0jJ/cn2hJKUU7EVEMkDDJYiIZICCvYhIBijYi4hkgIK9iEgG/H/RzYBHIBHToAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "array([0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0,\n",
       "       0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n",
       "       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n",
       "       0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n",
       "      dtype=int64)"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "label_pred = ms.labels_  # 获取聚类标签\n",
    "x0 = ss_x.inverse_transform(stand_df[label_pred == 0])\n",
    "x1 = ss_x.inverse_transform(stand_df[label_pred == 1])\n",
    "x2 = ss_x.inverse_transform(stand_df[label_pred == 2])\n",
    "plt.scatter(x0[:,1], x0[:,2], c=\"red\", marker='o', label='a')  \n",
    "plt.scatter(x1[:,1], x1[:,2], c=\"green\", marker='*', label='b')  \n",
    "plt.scatter(x2[:,1], x2[:,2], c=\"blue\", marker='+', label='c')  \n",
    "plt.xlabel('物种丰富度')  \n",
    "plt.ylabel('生物量') \n",
    "plt.legend(loc=1)  \n",
    "plt.text(x = -0.01 ,y = 52 , s = r'$Mg·hm^{-2}$',size=8)\n",
    "# plt.savefig(r'G:\\python林业资源\\出图/聚类meanshift.png',dpi=300)\n",
    "plt.show()\n",
    "label_pred"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "        nsp  sprichness    biomass  类别数目\n",
      "0  1.980769    0.064120   9.325737    79\n",
      "1  5.000000    0.250000  32.070680     8\n",
      "2  3.000000    0.136364  48.531041     1\n"
     ]
    }
   ],
   "source": [
    "center_ids = ms.cluster_centers_\n",
    "r1 = pd.Series(label_pred).value_counts()\n",
    "r2 = pd.DataFrame(ss_x.inverse_transform(center_ids))\n",
    "r = pd.concat([r2, r1], axis = 1)\n",
    "r.columns = [u'nsp',u'sprichness',u'biomass'] + [u'类别数目']\n",
    "print(r)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "DBSCAN(eps=0.6, leaf_size=20, min_samples=2, n_jobs=1)"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.cluster import DBSCAN\n",
    "dbscan = DBSCAN(eps=0.6,  # 邻域半径\n",
    "min_samples=2,    # 最小样本点数，MinPts\n",
    "metric='euclidean',\n",
    "metric_params=None,\n",
    "algorithm='auto', # 'auto','ball_tree','kd_tree','brute',4个可选的参数 寻找最近邻点的算法，例如直接密度可达的点\n",
    "leaf_size=20, # balltree,cdtree的参数\n",
    "p=None, # \n",
    "n_jobs=1)\n",
    "dbscan.fit(stand_df) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXsAAAESCAYAAAAcxXWZAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/d3fzzAAAACXBIWXMAAAsTAAALEwEAmpwYAAAfpUlEQVR4nO3df5Rc5X3f8fdXq6WSdqlAQpYNZHcVTDAQ4BQWjH3AuzI4MQ4JxDgx1RqwSZCNfKjrk+Q4qdwekC2cJg6x61jUa0DBaEMKdY1LgR6MY8nggM2K2vx2hYlWiGJVSK6wItZeab/945lBo9XMzp2Ze2fuj8/rnDkz9+798Twz0neeee5zv4+5OyIikm9zOl0AERFJnoK9iEgBKNiLiBSAgr2ISAEo2IuIFICCvYhIASjYi4gUgIK9iEgBzO10ATrNzC4Ezgbe7O6f6HR5RESSkIqWvZn9TzP7SsXyI2Y2GmG/28zsuFbO7e4PufvngK5WjiMikmZpadn3AEcDmNkwMA94LsJ+v+LuL0c9iZkNAddWrLrO3Xea2SeBDZFLKyKSMR0P9mZ2JPAaMF1atQr4DvCsmf074CLgMWCZu3+gYj8DjjKzW4DzgY+5+3fM7PvAD4HlpWOtAk4C3unum4BNM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gK8QsmDeSviiORZ40d0/H72aIo1RsJe8eQvwp4SW8w8IXTqbgbcB3yHcHbkX+LeEux23lLYZBpzQfw7wl6ULt5Puvn/mSdz9F2Y2x8x63X1v6RfFcaXHIczsT9z9L0uLCwm/MtYQuncGS+uPNrO51c4lEgcFe8mblwm3uW8nXKDdBbwA3ENo3f8x4YvgeaDH3f/ezHYTLsq+hfB/4mmgC/gj4CIzKwfg44FpM/tAafkIYAz4IuFawVcJXTznExJpPUjImPjOivL1uvtjZvbbwL2E2+6vBJ5ToJckKdhLrrj7i3DIOPf/QwjIXyME/hOA/0LIfXJPaZ8HS/t8qLQ8Xtr3+8AN5WNXduM0WqzS/qdQSp1b+mXwJUJa3I3AXzV4TJGGKNhLXvUSRsasIPSP/wPwAPBtd/8egJlNmtkR7v7L0j5HMPv/iQWz/L0buA6YrFh3DqGP/snS8jLgP5vZzcAi4EXgYkJXzu1mdizwH9z9241UVCQKjcYRiUHpgu0vXf+hJKUU7EVECkDpEkRECkDBXkSkABTsRUQKQMFeRKQAFOxFRArg/wM9qJMt252wzwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "array([-1,  0,  1,  0,  0,  0,  0,  0,  0,  0,  0,  2,  0, -1,  0, -1,  0,\n",
       "       -1,  0,  0,  2, -1,  0,  2,  2,  0, -1,  0, -1,  2,  0,  1,  0,  0,\n",
       "        0,  0,  0,  0,  0,  2,  0, -1,  0,  0,  0,  0,  0,  0,  0,  0, -1,\n",
       "        0,  2, -1, -1, -1,  2, -1,  2,  0,  0,  0,  0,  0,  0,  0,  0,  0,\n",
       "        0,  2,  0,  0,  2,  2, -1,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,\n",
       "        0,  0,  0], dtype=int64)"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "label_pred = dbscan.labels_  # 获取聚类标签\n",
    "x0 = ss_x.inverse_transform(stand_df[label_pred == 0])\n",
    "x1 = ss_x.inverse_transform(stand_df[label_pred == 1])\n",
    "x2 = ss_x.inverse_transform(stand_df[label_pred == 2])\n",
    "plt.scatter(x0[:,1], x0[:,2], c=\"red\", marker='o', label='a')  \n",
    "plt.scatter(x1[:,1], x1[:,2], c=\"green\", marker='*', label='b')  \n",
    "plt.scatter(x2[:,1], x2[:,2], c=\"blue\", marker='+', label='c')  \n",
    "plt.xlabel('物种丰富度')  \n",
    "plt.ylabel('生物量') \n",
    "plt.legend(loc=1)  \n",
    "plt.text(x = -0.01 ,y = 24 , s = r'$Mg·hm^{-2}$',size=8)\n",
    "plt.savefig(r'G:\\python林业资源\\出图/聚类DBSCAN.png',dpi=300)\n",
    "plt.show()\n",
    "label_pred"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
